local car := space(1)
local nbata :=space(0)

scaner(car, nbata)
?nbata


function SCANER (caracter,nBATA)

LOCAL tecla
LOCAL car:= SPACE(1)

caracter := 0

do while asc(car) != 13

   IF SET_SER()
      lee_ser(@car)
      if ( (asc(car) != 0) .and. (asc(car) != 10);
	   .and. (asc(car) != 13))
	 nBATA += car
      endif
   ENDIF

   tecla = inkey()
   if tecla != 0
      caracter := tecla
      //keyboard chr(tecla)
      car := chr(13)
   endif

enddo

RETURN .T.




